<template>
  <div id="homePage">
    <Header :path="path"></Header>
    <router-view></router-view>
    <Footer></Footer>
  </div>
</template>

<script>
import Header from "@/views/homePage/components/Header";
import Footer from "@/views/homePage/components/Footer";
export default {
  name: "homePage",
  components: {
    Header,
    Footer,
  },

  data() {
    return {
      path:{}
    };
  },
  // 组件内守卫
  beforeRouteEnter(to, from, next) {
    next((vm) => {
      vm.path = from;
      console.log(from);
      console.log(vm.path);
      next()
      // 通过 `vm` 访问组件实例
    });
  },
  created() {},
  mounted() {},
  methods: {},
  watch: {},
  computed: {},
};
</script>

<style lang="scss" scoped></style>
